package com.centanet.framework.rx;

import android.content.Context;

import com.bumptech.glide.Glide;

import rx.Observable;
import rx.Subscriber;

/**
 * 删除文件夹
 * Created by guilin on 16/1/12.
 */
final class ClearGlideCacheOnSubscribe implements Observable.OnSubscribe<Boolean> {

    private final Context context;

    public ClearGlideCacheOnSubscribe(Context context) {
        this.context = context.getApplicationContext();
    }

    @Override
    public void call(Subscriber<? super Boolean> subscriber) {
        Glide.get(context).clearDiskCache();
        subscriber.onNext(true);
        subscriber.onCompleted();
    }
}
